pp108 : getSelectedItems Method

getSelectedItems Method


This method returns an array of all selected items in the tree.

Syntax


atreeItems = treeID.getSelectedItems()

Return Value


Returns an array that contains all tree items that are selected. If the propertymultipleselectis set to true, and multiple items are selected, then this returns all the selected items. It returns NULL if no tree item is selected.

Example


The following example shows how the above method is used.

//Function call
var items = sampleTree.getSelectedItems();
//If items are not found, alert error, else display the data contained in each item
if (items)
{ 
    for(var item in selectedItems);
    {
        application.notify("Item " + item + ":\n\n" + cordys.getXML(selectedItems[item].data));
    }
}
else
{
    application.notify("Error ! Item not found !");
}

See Also


tree